@import '../../style/mixins/hairline.less';

@list-color: #888;
@list-item-hover-color: #f8f8f8;

.am-list {
  &-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding-left: 16px;
    font-size: 15px;
    line-height: 1.4;
    color: @color-text-title;
    &-hover {
      // hover 样式
      background-color: @list-item-hover-color;
    }
  }
  &-prefix {
    margin-right: 16px;
  }
  &-thumb {
    width: 30px;
    height: 30px;
    margin-right: 16px;
  }
  &-line {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
    padding-right: 15px;
    min-height: 52px;
    overflow: hidden;
  }
  &-content, &-extra {
    line-height: 1.5;
    width: auto;
    padding-top: 7px;
    padding-bottom: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  &-content {
    flex: 1;
    color: @color-text-base;
    font-size: 17px;
    text-align: left;
  }
  &-extra {
    flex-basis: 36%;
    color: @list-color;
    font-size: 16px;
    text-align: right;
  }
  &-brief {
    color: @list-color;
    font-size: 14px;
  }
  &-wrap {
    .am-list-content, .am-list-extra {
      white-space: normal;
      word-break: break-all;
    }
  }
  &-arrow {
    display: block;
    width: 15px;
    height: 15px;
    margin-left: 8px;
    background-image: url();
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    &-empty {
      visibility: hidden;
    }
  }
  &-line-bottom {
    .hairline('bottom');
  }
  // 子元素垂直对齐
  &-top {
    .am-list-line {
      align-items: flex-start;
    }
  }
  &-middle {
    .am-list-line {
      align-items: center;
    }
  }
  &-bottom {
    .am-list-line {
      align-items: flex-end;
    }
  }
  // 多行
  &-multiple {
    .am-list-line {
      padding: 6px 15px 6px 0;
    }
    .am-list-thumb {
      width: 36px;
      height: 36px;
    }
  }
  &-item.last {
    .am-list-line-bottom::after {
      display: none;
    }
  }
}
